<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>我的新发型(My Hair Styles)_逗游小游戏</title>
<script type="text/javascript" src="/js/jquery_min.js"></script>
<script type="text/javascript">
/****************************/
/* 我的代码没加密，全部自己原创 */
/* 也没进行封装，看起来直观的很 */
/* 如果你要用，带上下面文字即可 */
/* Code By Nokersang 2012-6 */
/****************************/

var game_id="657949";
var game_loading_timer=null;

var flash_show_width="100%";//flash初始显示宽度
var flash_show_height="100%";//flash初始显示高度
var flash_full_screen=false;//是否全屏标识
var zoom_level=0;//flash播放框缩放等级数值
var sr_left=0;//灯开关与middle框的相对left
var sr_top=0;//灯开关与middle框的相对top
var flash_file_size=1378304;
var flash_load_ok=false;
var cover_play_ok=false;
var cover_play_time=10;
var cover_play_timer=null;
var cover_play_taobao=0;
var need_iframe=0;

//获取Flash对象
function get_flash_obj(movieName){
	if(window.document[movieName]){return window.document[movieName];}
	if(navigator.appName.indexOf("Microsoft Internet")==-1){if (document.embeds && document.embeds[movieName]){return document.embeds[movieName];}}else{return document.getElementById(movieName);}
}

//同系列游戏滚动处理
function roll_space_init(){
	if($("#game_related_game .roll_box a").length<8){return false;}
	var remainder=$("#game_related_game .roll_box a").length%6;
	if(remainder>0){$("#game_related_game .roll a:lt("+(6-remainder)+")").clone().css("visibility","hidden").insertAfter("#game_related_game .roll a:last");}
	$("#game_related_game .roll_box").width(630);
	$("#game_related_game .go_left,#game_related_game .go_right").show();
	$("#game_related_game .go_left div,#game_related_game .go_right div").hover(function(){
		$(this).addClass("active");
	},function(){
		$(this).removeClass("active");
	});
	$("#game_related_game .go_left div").click(function(){
		$("#game_related_game .roll a:gt("+($("#game_related_game .roll_box a").length-7)+")").insertBefore("#game_related_game .roll a:first");
		$("#game_related_game .roll").css("left","-630px").stop(true,true).animate({"left":"0"},700);
		return false;
	});
	
	$("#game_related_game .go_right div").click(function(){
		$("#game_related_game .roll").stop(true,true).animate({"left":"-630px"},700,function(){
			$("#game_related_game .roll a:lt(6)").insertAfter("#game_related_game .roll a:last");
			$("#game_related_game .roll").css("left","0");
		});
		return false;
	});
}

//关灯处理函数
function light_switch(){
	var s_obj=$("#light_switch");
	var b_obj=$("#game_play_box .middle");
	if($("#full_screen_black_wall:visible").length){
		$("#full_screen_black_wall").hide();
		s_obj.removeClass("active").removeClass("high_level").find("strong").html("关灯");
		$("html").css({"overflow":"auto"});
		$("html").css({"margin-right":"auto"});
		$(window).unbind("keydown");
	}else{
		sr_left=s_obj.offset().left-b_obj.offset().left;
		sr_top=s_obj.offset().top-b_obj.offset().top;
		var now_width=document.documentElement.clientWidth;
		if(!$.browser.mozilla){$("html").css({"overflow":"hidden"})};
		$("html").css({"margin-right":document.documentElement.clientWidth-now_width});
		$("#full_screen_black_wall").show().css({"filter":"alpha(opacity=90)","opacity":"0.9","width":document.documentElement.clientWidth>document.documentElement.scrollWidth?document.documentElement.clientWidth:document.documentElement.scrollWidth,"height":document.documentElement.clientHeight>document.documentElement.scrollHeight?document.documentElement.clientHeight:document.documentElement.scrollHeight});
		s_obj.addClass("active").addClass("high_level").css({"left":Math.round(b_obj.offset().left+sr_left),"top":Math.round(b_obj.offset().top+sr_top)}).find("strong").html("开灯");
		$(window).keydown(function(e){
			if(e.keyCode==27){
				light_switch();
			}
		});
		$(window).one("resize",first_reset_light_off);
	}
}

function first_reset_light_off(){
	window.setTimeout(second_reset_light_off,0);
}
function second_reset_light_off(){
	var s_obj=$("#light_switch");
	var b_obj=$("#game_play_box .middle");
	if($("#full_screen_black_wall:visible").length){
		$("#full_screen_black_wall").hide().css({"width":document.documentElement.clientWidth>document.documentElement.scrollWidth?document.documentElement.clientWidth:document.documentElement.scrollWidth,"height":document.documentElement.clientHeight>document.documentElement.scrollHeight?document.documentElement.clientHeight:document.documentElement.scrollHeight}).show();
		s_obj.css({"left":Math.round(b_obj.offset().left+sr_left),"top":Math.round(b_obj.offset().top+sr_top)});
		$(window).one("resize",first_reset_light_off);
	}
}

function flash_cover_init(){
	if($("#flash_cover_box").length){cover_play_timer=window.setInterval(flash_cover_show,1000);}
}

//flash加载进度显示及完成后处理
function flash_loading_show(){
	var s=get_flash_obj("flash_loading_cover_obj");
	var p=get_flash_obj("flash_play_obj").PercentLoaded();
	try{
		s.SetPos(Math.abs(p));
		$("#flash_play_box .progress_bar").remove();
	}catch(e){
		if($("#flash_play_box .progress_bar").length){
			$("#flash_play_box .progress_bar").html(Math.abs(p)+"%");
		}else{
			if(cover_play_ok){
				$("<div class=\"progress_bar\">"+Math.abs(p)+"%</div>").appendTo($("#flash_play_box"));
				$("#flash_play_box .progress_bar").css({"left":$("#flash_play_box").outerWidth()/2-50,"top":$("#flash_play_box").outerHeight()/2+42}).show();
			}
		}
	};
	if(p==100 || p<0){
		flash_load_ok=true;
		window.clearInterval(game_loading_timer);
		window.setTimeout(function(){
			if($("#flash_play_box .progress_bar").length){$("#flash_play_box .progress_bar").remove()}
			$("#flash_loading_cover_obj").remove();
			$("#game_play_box .middle .alarm").remove();
			$("#game_play_box .middle .remind").removeClass("remind_hide");
			game_recommend_box_reset();
			if(cover_play_ok){$("#game_play_box .bottom").show();}
		},1000);
	}
}

//进度汇报函数
function progress_report(){
	window.setTimeout(function(){
		progress_scan(get_flash_obj("flash_play_obj").PercentLoaded());
	},60000);
}

//进度检查处理函数
function progress_scan(number){
	if(!flash_load_ok){
		if(number==0){
			$.getScript("http://track.doyo.cn/flash_loading_statistics?gid="+game_id+"&type=0");
		}else if(flash_file_size<1048576||number<104857600/flash_file_size){
			$.getScript("http://track.doyo.cn/flash_loading_statistics?gid="+game_id+"&type=1");
		}
	}
}

//flash播放框初始化
function flash_play_box_init(){
	game_recommend_box_init();
	if(flash_show_width>=910){
		flash_show_height=Math.round(flash_show_height*910/flash_show_width);
		flash_show_width=910;
		$("#game_play_box .bottom a.amplification").click();
		zoom_level=0;
	}else if(flash_show_width<=300){
		flash_show_height=Math.round(flash_show_height*300/flash_show_width);
		flash_show_width=300;
		$("#game_play_box .bottom a.narrow").click();
		zoom_level=0;
	}
	$("#flash_play_box_space").show();
	$("#flash_play_box_space,#flash_play_box,#flash_play_obj,#flash_play_obj embed,#flash_loading_cover_obj,#flash_loading_cover_obj embed").css({"width":flash_show_width,"height":flash_show_height});
	$("#flash_play_box").addClass("high_level").css({"top":Math.round($("#flash_play_box_space").offset().top),"left":Math.round($("#flash_play_box_space").offset().left)});
	game_recommend_box_reset();
	game_loading_timer=window.setInterval(flash_loading_show,300);
	$(window).one("resize",first_reset_flash_play_box);
}
//全屏功能初始化
function flash_full_screen_init(){
	flash_full_screen=true;
	$(document).scrollTop(0);
	if(!$.browser.mozilla){$("html").css({"overflow":"hidden"})};
	$("#full_screen_black_wall").show().css({filter:"alpha(opacity=100)","opacity":"1","width":document.documentElement.clientWidth>document.documentElement.scrollWidth?document.documentElement.clientWidth:document.documentElement.scrollWidth,"height":document.documentElement.clientHeight>document.documentElement.scrollHeight?document.documentElement.clientHeight:document.documentElement.scrollHeight});
	var wf=document.documentElement.clientWidth;var hf=document.documentElement.clientHeight;var pf=flash_show_width/flash_show_height;var ps=(wf-90)/hf;var w=0;var h=0;var l=0;var t=0;
	if(pf>ps){w=wf-90;h=w/pf;l=45;t=(hf-h)/2;}else{w=hf*pf;h=hf;l=(wf-90-w)/2+45;t=0;}
	$("#flash_play_box").addClass("no_border").css({"left":Math.round(l),"top":Math.round(t)})
	$("#flash_play_box").css({"width":Math.round(w),"height":Math.round(h)});
	if(need_iframe){
		$("#flash_play_iframe").css({"width":Math.round(w),"height":Math.round(h)});
		document.getElementById("flash_play_iframe").contentWindow.flash_change_size(Math.round(w),Math.round(h));
	}else{
		$("#flash_play_obj,#flash_play_obj embed").css({"width":Math.round(w),"height":Math.round(h)});
	}
	$("#full_screen_close_button").show().css({"left":document.documentElement.clientWidth-40,"top":"3px"}).one("click",function(){
		flash_full_screen=false;
		$(this).hide();
		$("#full_screen_black_wall").hide();
		$("html").css({"overflow":"auto"});
		$("#flash_play_box").css({"width":$("#flash_play_box_space").width(),"height":$("#flash_play_box_space").height()});
		if(need_iframe){
			$("#flash_play_iframe").css({"width":$("#flash_play_box_space").width(),"height":$("#flash_play_box_space").height()});
			document.getElementById("flash_play_iframe").contentWindow.flash_change_size($("#flash_play_box_space").width(),$("#flash_play_box_space").height());
		}else{
			$("#flash_play_obj,#flash_play_obj embed").css({"width":$("#flash_play_box_space").width(),"height":$("#flash_play_box_space").height()});
		}
		$("#flash_play_box").removeClass("no_border").css({"top":Math.round($("#flash_play_box_space").offset().top),"left":Math.round($("#flash_play_box_space").offset().left)});
		$(window).unbind("keydown");
		return false;
	});
	$(window).keydown(function(e){
		if(e.keyCode==27){
			$("#full_screen_close_button").click();
		}
	});
	$(window).one("resize",first_reset_flash_full_screen);
}

function first_reset_flash_full_screen(){
	window.setTimeout(second_reset_flash_full_screen,0);
}
function second_reset_flash_full_screen(){
	if(flash_full_screen){
		$("#full_screen_black_wall").css({"width":document.documentElement.clientWidth>document.documentElement.scrollWidth?document.documentElement.clientWidth:document.documentElement.scrollWidth,"height":document.documentElement.clientHeight>document.documentElement.scrollHeight?document.documentElement.clientHeight:document.documentElement.scrollHeight});
		var wf=document.documentElement.clientWidth;var hf=document.documentElement.clientHeight;var pf=flash_show_width/flash_show_height;var ps=(wf-90)/hf;var w=0;var h=0;var l=0;var t=0;
		if(pf>ps){w=wf-90;h=w/pf;l=45;t=(hf-h)/2;}else{w=hf*pf;h=hf;l=(wf-90-w)/2+45;t=0;}
		$("#flash_play_box").css({"left":Math.round(l),"top":Math.round(t)});
		$("#flash_play_box").css({"width":Math.round(w),"height":Math.round(h)});
		if(need_iframe){
			$("#flash_play_iframe").css({"width":Math.round(w),"height":Math.round(h)});
			document.getElementById("flash_play_iframe").contentWindow.flash_change_size(Math.round(w),Math.round(h));
		}else{
			$("#flash_play_obj,#flash_play_obj embed").css({"width":Math.round(w),"height":Math.round(h)});
		}
		$("#full_screen_close_button").css({"left":document.documentElement.clientWidth-40});
	}
	$(window).one("resize",first_reset_flash_full_screen);
}

//flash播放框缩放处理
function flash_zoom_process(){
	var z_level=Math.abs(zoom_level);
	var coefficient=0;
	if(zoom_level==0){
		coefficient=1;
		if(flash_show_width==910){$("#game_play_box .bottom a.amplification").click();zoom_level--;}//初始尺寸即为最大宽度的特殊处理
		if(flash_show_width==300){$("#game_play_box .bottom a.narrow").click();zoom_level++;}//初始尺寸即为最小宽度的特殊处理
	}else if(zoom_level>0){
		if(flash_show_width*Math.pow(1.2,z_level)>=910){
			$("#game_play_box .bottom a.amplification").hide();
			$("#game_play_box .bottom span.amplification_disable").css("display","inline-block");
			coefficient=910/flash_show_width;
		}else{
			coefficient=Math.pow(1.2,z_level);
		}
	}else if(zoom_level<0){
		if(flash_show_width*Math.pow(0.8,z_level)<=300){
			$("#game_play_box .bottom a.narrow").hide();
			$("#game_play_box .bottom span.narrow_disable").css("display","inline-block");
			coefficient=300/flash_show_width;
		}else{
			coefficient=Math.pow(0.8,z_level);
		}
	}else{}
	$("#game_recommend_box").hide();
	if(flash_show_width*coefficient<=580){
		$("#game_play_area").width(622);
	}else if(flash_show_width*coefficient<=670){
		$("#game_play_area").width(712);
	}else{
		$("#game_play_area").width("auto");
	}
	if(flash_show_height*coefficient<462){
		var pt=Math.round((462-flash_show_height*coefficient)/2);
		var pb=462-pt-flash_show_height*coefficient;
		$("#game_play_area").css({"padding-top":pt,"padding-bottom":pb});
	}else{
		$("#game_play_area").height("auto");
		$("#game_play_area").css({"padding-top":0,"padding-bottom":0});
	}
	$("#flash_play_box_space,#flash_play_box").css({"width":Math.round(flash_show_width*coefficient),"height":Math.round(flash_show_height*coefficient)});
	
	if(need_iframe){
		$("#flash_play_iframe").css({"width":Math.round(flash_show_width*coefficient),"height":Math.round(flash_show_height*coefficient)});
		document.getElementById("flash_play_iframe").contentWindow.flash_change_size(Math.round(flash_show_width*coefficient),Math.round(flash_show_height*coefficient));
	}else{
		$("#flash_play_obj,#flash_play_obj embed").css({"width":Math.round(flash_show_width*coefficient),"height":Math.round(flash_show_height*coefficient)});
	}
	$("#flash_play_box").css({"top":Math.round($("#flash_play_box_space").offset().top),"left":Math.round($("#flash_play_box_space").offset().left)});
	game_recommend_box_reset();
}


</script>
</head>

<body width="100%" style="background:url('/images/yx_bg.jpg') repeat-y scroll center top / 100% auto">
<div id="page_wallpaper" class="play_bg_0">
<div id="game_play_box">
	<div style="text-align:center;color:red;">
		<h1>我的新发型</h1>
	</div>
	<div class="middle">
		<div id="game_play_area" style="width:100%;">

			<div id="flash_play_box" style="width:100%;">
				<object width="100%" align="middle" id="flash_play_obj" type="application/x-shockwave-flash" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
					<param name="allowScriptAccess" value="always">
					<param name="quality" value="high">
					<param name="wmode" value="opaque">
					<param name="menu" value="false">
					<param name="allowNetworking" value="internal">
					<param name="movie" value="http://f1.doyo.cn/flash/swf/55/4522c100a89bf80ea623dcbfd901d6.swf">
					<embed width="100%" height="931px" align="middle" name="flash_play_obj" type="application/x-shockwave-flash" allowScriptAccess="always" quality="high" wmode="opaque" menu="false" internal="allowNetworking" src="http://f1.doyo.cn/flash/swf/55/4522c100a89bf80ea623dcbfd901d6.swf" />
				</object>

			</div>
		</div>
	</div>
</div>
</div>
</body>
</html>